package com.dong.payment.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

/**
 * @author DJ
 * @description
 * @date 2022/1/2 2:39 下午
 **/
@RestController
@Slf4j
public class PaymentController {

    @Value("${server.port}")
    private String serverPort;

    /**
     * 获取注册到zk上的当前服务端口号
     *
     * @param
     * @return java.lang.String
     * @author DJ
     * @date 2:43 下午 2022/1/2
     **/
    @GetMapping("payment/zk/get-server-port")
    public String getServerPort() {
        return "spring cloud with zookeeper:" + "端口号：" + serverPort + "\t" + UUID.randomUUID().toString();
    }
}
